//
//  President.m
//  Nav
//
//  Created by KaiKai on 11-8-9.
//  Copyright 2011年 SDS. All rights reserved.
//

#import "President.h"

@implementation President
@synthesize number;
@synthesize name;
@synthesize fromYear;
@synthesize toYear;
@synthesize party;

- (void)dealloc
{
	[name release];
	[fromYear release];
	[toYear release];
	[party release];
	[super dealloc];
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	[coder encodeInt:self.number forKey:KPresidentNumberKey];
	[coder encodeObject:self.name forKey:KPresidentNameKey];
	[coder encodeObject:self.fromYear forKey:KPresidentFromKey];
	[coder encodeObject:self.toYear forKey:KPresidentToKey];
	[coder encodeObject:self.party forKey:KPresidentPartyKey];
}

- (id)initWithCoder:(NSCoder *)coder
{
	if (self = [super init])
	{
		self.number = [coder decodeIntForKey:KPresidentNumberKey];
		self.name = [coder decodeObjectForKey:KPresidentNameKey];
		self.fromYear = [coder decodeObjectForKey:KPresidentFromKey];
		self.toYear = [coder decodeObjectForKey:KPresidentToKey];
		self.party = [coder decodeObjectForKey:KPresidentPartyKey];
	}
	
	return self;
}

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

@end
